package haois.module.system.service;

import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import haois.util.sdk.JDKFactory;
import haois.util.sdk.SmsJdk;
import org.springframework.stereotype.Service;


/**
 * Created by RuiHaoZ on 2018/3/22 22:26
 */
@Service
public class AliCloudService {

    public SendSmsResponse sendCode(String phoneNumbers,String code) throws ClientException {
        try {
            SmsJdk smsJdk = JDKFactory.createSms();
            SendSmsResponse sendSmsResponse = smsJdk.sendSms(phoneNumbers,code);
            return sendSmsResponse;
        } catch (ClientException e) {
            e.printStackTrace();
            return null;
        }
    }

}


